package com.itheima.service.impl;

import com.itheima.domain.Huangzhe;
import com.itheima.domain.Keshi;
import com.itheima.mapper.SubscribeMapper;
import com.itheima.service.SubscribeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("subscribeServiceImpl")
public class SubscribeServiceImpl implements SubscribeService {

    @Autowired
    private SubscribeMapper subscribeMapper;

    @Override
    public List<Keshi> findKeshi() {
        try {
            List<Keshi> keshilist = subscribeMapper.findKeshi();
            return keshilist;
        } catch (Exception e) {
            e.printStackTrace();
            return null;
        }
    }

    @Override
    public void save(Huangzhe huangzhe) {
        try {
            subscribeMapper.save(huangzhe);
        } catch (Exception e) {
            e.printStackTrace();
        }
    }
}
